<?
class MessagesController extends CFD_Controller_Action
{
    public function showAction()
	{
	  $messagesTable = new Application_Model_Messages();
	  $this->view->msg = $messagesTable->fetchRow($messagesTable->select()->where('id = ?', (int)$_GET['id']));

	  $this->view->title = "Message: ".$this->view->msg->title;
	  if ($this->view->msg)
	    $this->view->msg->setRead($this->user->id);
	}

    public function inboxAction()
    {
	  $this->view->title = "Messages";
	  $messagesTable = new Application_Model_Messages();
	  $this->view->msgList = $messagesTable->fetchAll($messagesTable->select()->order('id DESC'));
    }
}
